#include<iostream>

using namespace std;

/*class Person
{
  public:

  protected:
    string _name = "LiHua";
    int _age = 18;

  private:
    int _todel = 10;
};

struct Techer : Person{
  
};

class Student :  Person 
{
  void Func()
  {
//  cout<<Person::_todel<<endl;
    cout<<"study now"<<endl;
  }
};


void test_1()
{
  Student st1;
  Person per1;

}
//////////////////////////////////////

class A
{
  public:
    int a = 9;
    int b = 10;
};

class B : public A
{
  public:
    int a = 99;
    int b = 100;
    int c = 500;
};

void test_2()
{
  B b1;
  cout<<b1.a<<" "<<b1.b<<endl;
  cout<<b1.A::a<<" "<<b1.A::b<<endl;
}
*/


/////////////////////////////////////////
/*
class Parent
{
  public:
    Parent(const char*name = "Zhangsan")
    :_name(name)
  {
    cout<<"Parent()"<<endl;
  }

    Parent(const Parent& par){
      cout<<"Parent(const Parent& par)"<<endl;  
    }

    Parent& operator=(const Parent& par){
      cout<<"Parent& operator=()"<<endl;
      if(&par!=this){
        _name = par._name;
      }
      return *this;
    }

    ~Parent(){
      cout<<"~Parent()"<<endl;
    }
    void print(){
      cout<<_name<<endl;
    }
  protected:
    string _name;
};
*/


/*class Child : public Parent
{
  public:

   /* Child(const char* name,size_t age)
      ://Parent::_name(name) error
        Parent(name)
      ,_age(age)
    {
      cout<<"Child()"<<endl;
    }*/


   // Child(const char* name,size_t age)
  //    ://Parent::_name(name) error
  //    _age(age)
 //   {
 //     cout<<"Child()"<<endl;
 //   }

    /*Child(const Child& chi)
    :Parent(chi)
    {
      cout<<"Child(const Child& chi)"<<endl;
    }*/

  //  ~Child(){
 //     Parent::~Parent();
  //    cout<<"~Child()"<<endl;
   // }

   /* Child& operator=(const Child&chi){
      cout<<"Child&operator=()"<<endl;
      if(&chi != this){
        Parent::operator=(chi);
        _age = chi._age;
      }
        return *this;
    }*/
//  protected:
//    size_t _age;
//};

////////////////////////////////////////////////////////////

class S ;
class P{
  public:
  friend void FuncP(const P& par,const S& chi);
  protected:
  int _age = 18;
};

class S : public P{
  public:

 // friend void FuncP(const P& par,const S& chi);
  protected:
  int _id = 123;
};

void FuncP(const P& par,const S& chi){
  cout<<par._age<<endl; 
//  cout<<chi._id<<endl;
}

void test_3(){
  FuncP(P(),S());
}

////////////////////////////////////////////////


class Par{
  public:
    Par()
    {
      ++_count;
    }
  public:
    static int _count ;
};
int Par::_count = 0;

class Chi:Par{
public:
  Chi(){
    ++_count;
  }
  void Print(){
    cout<<Par::_count<<endl;
  }
};

void Test(){
  Chi ch1;
  ch1.Print();
}

///////////////////////////////////

class A1{
  public:
    A1(const string& name = "A1" )
      :_A1name(name)
    {}
    string _A1name;
};

class A2{
  public:
    A2(int tmp = 20)
      :id(tmp){}
    int id;
};

class Aa: public A1, public A2
{
  public:
  void Print(){
    cout<<A1::_A1name<<endl;
    cout<<A2::id<<endl;
  }
};

void test_Aa(){
  Aa a1;
  a1.Print();
  
}

int main()
{

  test_Aa();

//------------------------------
//Test();

//------------------------------
//cout<<"hello world"<<endl;
 
//test_1(); 
 


//  test_2();


 /* Child ch1("Lihua",18);
  Child ch2(ch1);
  Parent p1 = ch1;

  p1 = ch1;
  p1.print();
  ch1 = ch2;
  return 0;
  */


  /*Child ch1("Lisi",18);

    Child ch2("wang",20);
  ch1 = ch2;
  Child ch3(ch2);*/

//  Child ch1("Lisi",18);
}
